package dk.dashboardFP.utils.describeObjectUtil {
	import flash.utils.describeType;

	/**
	 * @author josef
	 */
	public class ObjectDescription {
		private var _descriptionXML : XML;

		public function ObjectDescription(targetObject:*) {
			
			// get XML 
			_descriptionXML=describeType(targetObject);
		}
		
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		// getters
		//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		 
		public function get isDynamic() : Boolean {
			if (_descriptionXML.@isDynamic == "true") {
				return true;
			} 
			return false;
		}
		
		public function get className() : String {
			var typeString : String = _descriptionXML.@name.toString();
			if (typeString.indexOf("::") != -1) {
				var returnString : String = typeString.split("::")[1];
				return returnString; 
			} else {
				return typeString;
			}
		}
	}
}
